package com.shijie.utils;

import java.io.File;

import me.chanjar.weixin.common.exception.WxErrorException;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaQrcodeServiceImpl;
import cn.binarywang.wx.miniapp.bean.WxMaCodeLineColor;
import cn.binarywang.wx.miniapp.bean.WxMaWxcodeLimit;

public class PnWxMaQrcodeServiceImpl extends WxMaQrcodeServiceImpl {
	private WxMaService wxMaService;
	public PnWxMaQrcodeServiceImpl(WxMaService wxMaService) {
		super(wxMaService);
		this.wxMaService= wxMaService;
	}
	  @Override
	  public File createWxCodeLimit(String scene, String page, int width, boolean autoColor, WxMaCodeLineColor lineColor) throws WxErrorException {
	    WxMaWxcodeLimit wxMaWxcodeLimit = new WxMaWxcodeLimit();
	    wxMaWxcodeLimit.setScene(scene);
	    wxMaWxcodeLimit.setPage(page);
	    wxMaWxcodeLimit.setWidth(width);
	    wxMaWxcodeLimit.setAutoColor(autoColor);
	    wxMaWxcodeLimit.setLineColor(lineColor);
	    return this.wxMaService.execute(new PnQrCodeRequestExecutor(this.wxMaService.getRequestHttp()),
	      GET_WXACODE_UNLIMIT_URL, wxMaWxcodeLimit);
	  }
}
